home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 November / PCWNOV07.iso / Software / Freeware / NSIS 2.29 / nsis-2.29-setup.exe / Examples / Memento.nsi < prev    next >
Encoding:
Text File  |  2007-03-10  |  1.5 KB  |  78 lines

  1. !include LogicLib.nsh
  2. !include Memento.nsh
  3.  
  4. Name Memento
  5. OutFile Memento.exe
  6.  
  7. XPStyle on
  8.  
  9. ShowInstDetails show
  10.  
  11. Page components
  12. Page instfiles
  13.  
  14. # settings
  15.  
  16. !define MEMENTO_REGISTRY_ROOT HKCU
  17. !define MEMENTO_REGISTRY_KEY "Software\NSIS\Memento Test"
  18.  
  19. # restore
  20.  
  21. Function .onInit
  22.  
  23.   ${If} ${Cmd} `MessageBox MB_YESNO "Would you like to load an example state?" IDYES`
  24.     
  25.     DeleteRegKey  HKCU "Software\NSIS\Memento Test"
  26.  
  27.     WriteRegStr   HKCU "Software\NSIS\Memento Test" MementoSectionUsed ""
  28.     WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_horse   1
  29.     WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_chicken 1
  30.     WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_donkey  0
  31.     WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_croc    0
  32.  
  33.   ${EndIf}
  34.  
  35.   ${MementoSectionRestore}
  36.  
  37. FunctionEnd
  38.  
  39. # sections
  40.  
  41. ${MementoSection} horse sec_horse
  42. ${MementoSectionEnd}
  43.  
  44. ${MementoSection} donkey sec_donkey
  45. ${MementoSectionEnd}
  46.  
  47. ${MementoSection} chicken sec_chicken
  48. ${MementoSectionEnd}
  49.  
  50. SectionGroup /e group
  51.  
  52.   SectionGroup /e group
  53.  
  54.     ${MementoSection} croc sec_croc
  55.     ${MementoSectionEnd}
  56.  
  57.     ${MementoSection} cow sec_cow
  58.     ${MementoSectionEnd}
  59.  
  60.   SectionGroupEnd
  61.  
  62. SectionGroupEnd
  63.  
  64. ${MementoUnselectedSection} dinosaur sec_dinosaur
  65. ${MementoSectionEnd}
  66.  
  67. # done...
  68.  
  69. ${MementoSectionDone}
  70.  
  71. # save
  72.  
  73. Function .onInstSuccess
  74.  
  75.   ${MementoSectionSave}
  76.  
  77. FunctionEnd
  78.